package tcln.gxtx.client.utils;

/**
 * A simple interface for objects whose 'changed' state should be tracked.
 * 
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
public interface ChangeTrackable {
    
    /**
     * @return current "change" state of an object.
     */
    public ChangeState getState();

    /**
     * @param newState
     *            new "change" state.
     */
    public void setState(ChangeState newState);

    /**
     * Tree model change states.
     * 
     * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
     */
    public static enum ChangeState {

        /**
         * State: new.
         */
        NEW,

        /**
         * State: modified.
         */
        MODIFIED,

        /**
         * State: removed.
         */
        REMOVED,

        /**
         * State: unchanged.
         */
        UNCHANGED
    }
}
